#include "../3dparty/gtest-support.h"

#include "../include/stack.h"

TEST( StackTestCast, StackTest )
{
    StackNodeType data = 66;

    ListStack S;
    InitStack( &S );

    EXPECT_EQ( OK, Push( &S, &data ) );

    data = 88;

    EXPECT_EQ( OK, GetTop( &S, &data ) );

    EXPECT_EQ( 66, data );

    data = 88;

    EXPECT_EQ( OK, Push( &S, &data ) );

    data = 77;

    EXPECT_EQ( OK, GetTop( &S, &data ) );
    EXPECT_EQ( 88, data );

    EXPECT_EQ( OK, Pop( &S, &data ) );
    EXPECT_EQ( 88, data );

    EXPECT_EQ( OK, Pop( &S, &data ) );
    EXPECT_EQ( 66, data );
}